<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/jsp/ningbo/common.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="format-detection" content="address=no;">
    <title>岗位列表</title>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/jsp/ningbo/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/jsp/ningbo/css/job.css">
	<script src="<%=request.getContextPath()%>/jsp/ningbo/js/jquery-1.9.1.min.js"></script>
    <script src="<%=request.getContextPath()%>/jsp/ningbo/js/bootstrap.min.js"></script>
</head>
<body>
<input type="hidden" id="queryTypeId" value="${queryType}">
	<!-- <!-- head start -->
    <header id="header">
            <h1>岗位列表</h1>
    </header>
    head end
    <div class="mt50"></div> -->
    <div class="content">
    	<!-- list start -->
    	
        <c:if test="${empty resultList }">
	        <div style="margin:0 auto;clear:both;text-align:center;padding:10% 0;">
	    		<img src="<%=request.getContextPath()%>/jsp/ningbo/images/nofind.png" width="69" height="69"> 
	       	 	<p>无相关记录</p>
    		</div>
    	</c:if>
        <ul class="list_job rank-box on" id="thelist">
        		<c:if test="${not empty resultList }">
	            <c:forEach var="resultObj" items="${resultList }">
	             <li onClick=query_detail('${resultObj.detailstr}')>
		           	 <h3>${resultObj.acb216}</h3>
		             <div class="job_bot">
		             	<div class="post">
		                	<h5>${resultObj.aab004}</h5>
		                    <span>${resultObj.total_renshu}人</span>
		                </div>
		                <div class="date">截至:${resultObj.aae031}</div>
		             </div>
		         </li>
	            </c:forEach>
	            </c:if>
        </ul>
        <c:if test="${not empty resultList }">
	        <div class="bg_gray10"></div>
			<div class="bottom_load" id="loadMore" onclick="loadMore();">点击加载更多</div>
    	</c:if>
        <!-- list end -->
    </div>
</body>
    <script>
    	
   	function query_detail(detailStr){
    		window.location.href = ctxPath + "/nbwx/m/jobDetail.json?detailStr="+detailStr;
   	}
   	
   	var commitFlag_A = "1";
   	var pageNo=1;
   	var Constant_pageSize = 20;
   	var noDataFlag="1";//默认是还有数据
   	function loadMore(){
   			if(commitFlag_A!="1"){
   				return "";
   			}
   			if(noDataFlag=="2"){
   				return "";
   			}
   			pageNo++;
   			$("#loadMore").html("Loading...");
   			commitFlag_A = "2";
   			var queryType = $("#queryTypeId").val(); 
   			var data = {};
   			data.pageNo = pageNo;
   			data.queryType = queryType;
   			var showResultDataObj = $("#thelist");
   			var item = $("#itemValId").val();
   			$.ajax({
   				url : ctxPath+'/nbwx/m/query_gangwei_more.json',
   				type : 'post',
   				data : data,
   				dataType : 'html',
   				ifModified : true,
   				cache : false,
   				success : function(data) {
   					commitFlag_A = "1";
   					data = $.parseJSON(data);
   					if(!(data.resultCode>=0)){
   						noDataFlag="2";
   						$("#loadMore").html("加载已完成!");
   						return;
   					}
   					var tempObj=eval(data.model); 
   					if(tempObj.length>0){
   						var htmlStr ="";
   						for(var i=0;i<tempObj.length;i++){ 
   							var itemInfo  = tempObj[i];
   							htmlStr +="<li onClick=query_detail('"+itemInfo.detailstr+"')>"; 
   							htmlStr +="<h3>"+itemInfo.acb216+"</h3>"; 
   							htmlStr +="<div class='job_bot'>"; 
   							htmlStr +="<div class='post'>"; 
   							htmlStr +="<h5>"+itemInfo.aab004+"</h5>"; 
   							htmlStr +="<span>"+itemInfo.total_renshu+"人</span>"; 
   							htmlStr +="</div>"; 
   							htmlStr +="<div class='date'>"+itemInfo.aae031+"</div>";
   							htmlStr +="</div>"; 
   							htmlStr +="</li>"; 
   						}
   						
   						if(tempObj.length==Constant_pageSize){
   							noDataFlag="1";
   							$("#loadMore").html("点击加载更多");
   						}else if(tempObj.length<Constant_pageSize){
   							noDataFlag="2";
   							$("#loadMore").html("加载已完成!");
   						}
   						showResultDataObj.append(htmlStr);
   					}else{
   						noDataFlag="2";
   					}
   				}
   			});   	
   	 }
   
    </script>
</html>